-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flipping demand
#862
Flipping demand
#862
Conversation
Hardly a better refactor currently. But after the proper the further work on `force` going to give beautiful code: ```haskell f = pure $ case free force id of NVStr' s -> pure s _ -> mempty ```
…tion Argument order change has functional argument - so it is not possible to elegantly switch into new code, and requires to go though transition. So doing the work while doing needed refactoring at the same time. This style of code currenly may seem more noizy, but really it is more straight-forward, it mentions only operations & transformatios, types can be looked in the HLS. With the future work #850 this style of the code would radically start to simplify itself, so please bear with me.
Currently surprised the benchmark saves are still small. Sadly, the benchmarks so far not show huge improvement. But need to inspect the profiling more. I wait on one at the end of #850. But more and more thinking that 1-threadness with no system of lock management, flipped style in which the project was created produces unoptimized code and lazy boxed types are the main points. Maybe they are the main nails performance hangs on in the thunk processing. The more we streamline the code - the more magnitude of the gains would start to snowball. |
A milestone stage towards #850
Remember that
force
would lose the functional argument.demand
would be something along the lines offree -> f =<< force thunk
.By the result of the
demand
- it would be seen, is in viable to keep it, or simply replace with thatfree -> f =<< force thunk
or movefree
logic intoforce
and useforce
with=<<
.So instead of the
demand
it would be between function and its argument would beforce v
.In other words, unflipping required to unfold the code.
But the further following folded elegantness worth it.
Also all those
\case
really are helper functions that explain themself.Or,
alg
if you want.